﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using iAnywhere.Data.SQLAnywhere;

namespace SybaseWIT
{
    public partial class glowneOkno : Form
    {
        public glowneOkno()
        {
            InitializeComponent();
        }
        SAConnection conn;
        private void button1_Click(object sender, EventArgs e)
        {
            conn = new SAConnection("ENG=asa11;DBN=asa11;Uid=roslanih;Pwd=emlpuqz;Links=tcpip(Host=city.wsisiz.edu.pl);");
            try
            {
                conn.Open();
            }
            catch (Exception excp)
            {
                MessageBox.Show(excp.Message);
            }
            SACommand cmd = new SACommand("SELECT count(*) FROM test1",conn);
            int tmp = (int)cmd.ExecuteScalar();
            MessageBox.Show(tmp.ToString());
            cmd.Dispose();
            conn.Close();
            conn.Dispose();

        }
    }
}
